﻿create PROCEDURE Sync.SP_RolesPermissions_SelectChanges
@LastRowVersion rowversion,
@FilterdColumn UNIQUEIDENTIFIER
AS 
BEGIN 
	SELECT 
        t.[PermissionID],t.[RoleID],
		
		t.IsDeleted,
		t.LastUpdatedDate
	FROM [dbo].[RolesPermissions] g RIGHT JOIN Sync.RolesPermissions_Tracking t  
    ON t.PermissionID = g.PermissionID AND t.RoleID = g.RoleID 
	WHERE @LastRowVersion IS NULL OR t.Version > @LastRowVersion
    END





